<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>获得请求头的所有信息</title>
    
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
  </head>
  <body>
    <%
    Enumeration<String> enu=request.getHeaderNames();
    while(enu.hasMoreElements())
    {
       String headerName=enu.nextElement();
       String headerValue=request.getHeader(headerName);
     %>
     <h5><%=headerName%>--><%=headerValue%></h5>
     <%
     }
      %>
      <br>
      <%
       String method=request.getMethod();
       String ip=request.getLocalAddr();
       String name=request.getServerName();
       String path1=request.getServletPath();
       String contextPath=request.getContentType();
       String type=request.getAuthType();
       String character=request.getCharacterEncoding();
       String context=request.getContentType();
       %>
       <h3><%=method%></h3>
       <h3><%=ip%></h3>
       <h3><%=name%></h3>
       <h3><%=path1%></h3>
       <h3><%=contextPath%></h3>
       <h3><%=type%></h3>
       <h3><%=character%></h3>
       <h3><%=context%></h3>
  </body>
</html>